<template>
  <div>
    <!-- 待评价 -->
     
    <daipingjia :yeshu="DaiPpingJia"></daipingjia>
  </div>
</template>

<script>
import API from "../../http/API";
import daipingjia from "../orderform/zhujian.vue";
export default {
  name: "pingjia",
  components: {
    daipingjia,
  },
  data() {
    return {
      DaiPpingJia: 1,
    };
  },
    activated() {
    this.guanb();
  },
  methods: {
    lazyLoading() {
      this.$route.meta.Yaxis = window.pageYOffset;

      let scrollTop =
        document.documentElement.scrollTop || document.body.scrollTop;
      let clientHeight = document.documentElement.clientHeight;
      let scrollHeight = document.documentElement.scrollHeight;
      if (scrollTop + clientHeight >= scrollHeight) {
        console.log("滚动到底部，触发");

        this.mai();
      }
    },
    mai() {
      setTimeout(() => {
        console.log("发起网络请求");
        this.DaiPpingJia++;
        console.log(this.complete);
      }, 500);
    },
    guanb() {
      window.addEventListener("scroll", this.lazyLoading);
    },
  },
  deactivated() {
    window.removeEventListener("scroll", this.lazyLoading);
  },
};
</script>

<style lang="less" scoped>
.body{
  height: 100%;
}
</style>